<template>
	<view>
		<video class="video_box" :src="videoUrl"></video>
		<view class="btn" @click="preservation">保存相册</view>
	</view>
</template>

<script>
import { saveVideoToPhotosAlbum } from '@/utils/download/index.js';
export default {
	data() {
		return {
			videoUrl: ''
		};
	},
	onLoad(option) {
		this.videoUrl = JSON.parse(decodeURIComponent(option.videoUrl));
	},
	methods: {
		preservation() {
			saveVideoToPhotosAlbum(this.videoUrl);
		}
	}
};
</script>

<style lang="scss">
.btn {
	margin: auto;
	margin-top: 30rpx;
	width: 678rpx;
	height: 87rpx;
	background: #3662ec;
	border-radius: 14rpx;
	font-weight: 400;
	font-size: 29rpx;
	color: #ffffff;
	line-height: 87rpx;
	text-align: center;
}
.video_box {
	width: 100%;
	height: 1260rpx;
}
</style>
